package com.zhang.config;
import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119639150";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCbR0IcEoZRglrMfE17v7rzayiCfGeKuo9GFgspDNHs9NiwHK39Z+xVhpY+xVPxYfb4MfvHeN0muz5oX22MQJm2Eo1BgZIciT0DdjGK5trwV9AHMiIY2TmlacnB77ilbmmPHm95cD69ERA1lJ1jqIRR4zvPso7ukN8jIxbV+m+wyDXFmKl03uy/W49X1N82CNmYtMSmrO1109uBr2wEVZFzlwwv9Uf36o2ahR7Scl9OBD62N6degJIaFW8TACkhClATeY2SomkTPA5zTVb2VLGpexWKmDZVhAtPmA5GZnKe+9KJhS8wNqdGiksqasYExdReOqMNw80GkXAk/Ufv/a1/AgMBAAECggEBAJdAvDbYHJp9HbEeS+OFCbhe42DniXxq6XDdvBVKdZoZjpFN/nVeq6lLpkKSuIfiY020cosFQnad4daNTgpWSuQ+AfaTHh5J2HLsyKmC4jVHdE3uGaSWxD5KY8tTlUsf2BcfEHr8SUClxGJM11riJbIWZIaWagAcgh6Z6X6Zqf5KH1pZwnLOn0a0AwKMZusdo7TDtR8o1spoDkONzDb6TevrJcoxdqXl11haghwwGC8AT8rGlEHHUOJzJsN8vHSumqleqrHcKnSTNMvPKq1Kwrx1MKrY8++vk8+B/SgS53fNgAcDJElqEv+ooPReLIym6jZBCQwyUzY4oCQaO17XmRECgYEA5RO7gP4DJZokRtwnN68fBeUN4ffoL0bgQLT7tUbmEcCHucatDVh/P+/Y8m+V4TmomFxLRsk79Cxn5/SyX7XMrH0UwGYtwW4dABehtTEzoZpyc7oxUUDrozJaxQULEnaxt/4tKI8rZgymyMPPUziI2CWKWG2BwE09bRsedufihO0CgYEArYcion2r5XkMB+KnQZ98QBQXIUswSY4iFGOSV5/GPigalWZC8LPBtYlt0lsCM9TJgC2kS3CsURY8gkWEYZclzijKf6W2DyTeuk8syfU6qdXI/IohK9U+s576AlsHmO4le9ILz9DseKGmGn5qO3A5NEdWM8d84YhM/BDlCMzvupsCgYABXPqyq9BM+vvYSBsbo7klidVpUNZa4asX93u/+moIFQM5wcrp12r6cGz0FGHp8zPjpDj2dOAcdd8wbC5bj3NmW2AyPOlsy0D07S8TKvXJsmeX9LWybBZ65CPSJFOKipZIKAUQxrlVZCHh8/hZ4G5ACwkluZEaGduRuKWXw41/iQKBgQCLR13bQjdIdgHcCmXo3BOkcvuls23MfBKKfukk/47ksNe1dmDgRceC6A2Hu5hm9bHN+dRW4NbONqTWgumgUur7L+5oyh74xMUokQgICZbOXlN1r4C0Z/JtxXoxjdLpQqw/V/Y3FR/YKxbhSPoHPyoK9f8QjFuFwhrYbs8GY0c/ZQKBgQCGAVcCtz+DvwIZ0Qrc+CwXvqsrCSBicOncEYJYIUr4rWnXn181da4w6rM7AKva21EpiuLxO4BNISXjQ8PXc8VRAS6bbreogww9AvU3qxTSLWV3S5h/cbJDU8KR8wKdNKJpDGv2vJaIcJ+epsf7jefbUjGBg11TkHiGCiE2YscTmQ==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAhSzZf5sS3REWQmP9rK3e/LXioJkfcHlkYCpZU/TNAepDb3UGL3I6LAx3nKsLlM4QNW+zTZ5q4QtFdPWkCjbX6FNvcB51GgUWEhPSRBorV8Ej0GxVI1NYkBQK1lAaXM7JK61XI2f7pZzrjhKSHZanydBiK6Yb4caxgcOyDafgOCfEis9lJq81J1UHmx6sixoN/UNhW4aDkH5uhivGWVSq7822T9OjNVvIdgC2uXjI3EMPh+jVcRcstRuxG5DEcHiPsTZdsCL3tB/C51SJMVDX7xLL+nLZQOi+cPNM/puziCYr3fEmVLXRcla75Ys9Id3fxyC2O7E3ofAILf4qY/7jnQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost/success.html";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "E:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}


